home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 654 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: holland.tessi.com!not-for-mail
  2. From: paulb@holland.tessi.com (Paul Blattner)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Binary IOStreams?
  5. Date: 5 Jan 1996 08:30:15 -0800
  6. Organization: Quality Software Engineering, Inc.
  7. Message-ID: <4cjjmn$73i@holland.tessi.com>
  8. References: <DKny36.A0@BearRiver.com> <4ch1ei$63g@overload.lbl.gov>
  9. NNTP-Posting-Host: holland.tessi.com
  10.  
  11. In article <4ch1ei$63g@overload.lbl.gov>, E. J. Moler <EJMOLER@LBL.GOV> wrote:
  12. >According to "The Draft Standard C++ Library" by P. J. Plauger,
  13. >one can create streams with mode arguments that determine the
  14. >characteristics of the stream.  
  15. >For example, to open a binary file with filename s, 
  16. >    
  17. >    ifstream fin(s, ios::binary);
  18. >
  19. >There are other modes that can be or'd into the second argument that
  20. >do things like append to an ofstream, etc.
  21. >
  22. >So the functionality that you want is probably already there.
  23. >
  24. >
  25. Unfortunately, this doesn't do what we want.  The ios::binary flag only
  26. insures that on DOS / windows paltforms, newline characters don't get
  27. expanded to CR/LF pairs on output and CR/LF doesn't get combined to
  28. a newline on input.  On UNIX platforms, it has no effect at all.
  29.  
  30. What's more, the result is still ASCII representation of data in 
  31. the file.
  32.  
  33. I suggest that you look at Rogue Wave's Tools.h++ library which
  34. augments the language by providing a new set of stream classes
  35. called virtual streams.  These classes provide 
  36.  
  37.     - true, binary I/O streams
  38. or
  39.     - network based streams built on the XDR protocol,
  40. and in the new Net.h++
  41.     - TCP/IP based streams.
  42.  
  43. Paul.
  44.  
  45. =======================================================================
  46. QSE, Inc.                      The Successful Transition Seminar
  47. PO Box 303                     Training and mentoring in:
  48. Beaverton  OR  97075               C++
  49. (503) 538-8256                     Tools.h++
  50. -- 
  51. Quality Software Engineering, Inc.      The Successful Transition Seminar
  52. PO Box 303                              "Helping companies make a successful
  53. Beaverton  OR  97075                     transition to object technology"
  54. (503)  538-8256                 Training in C++ and Tools.h++
  55.